<template>
    <div class="userBox">
        <searchFrom :data="data" :total="total" :loadData="loadData" :currentPage="currentPage"/>
        <userTable :data="data" :total="total" :loadData="setPage" :page="currentPage"/>
    </div>
</template>

<script setup lang="ts">
import { useUserList } from '@/hooks/useUser';
import searchFrom from './ui/searchForm.vue'
import userTable from './ui/userTable.vue'
import {useRouter} from 'vue-router'


const [data,total,loadData,currentPage] = useUserList()

const router = useRouter()
const setPage=(page:number)=>{
    router.replace(`?page=${page}`)
    loadData(page)
}
</script>

<style scoped>

</style>